<script type="text/javascript" language="javascript">
$(document).ready(function()
{
	
	$('.noneregist').click( function(){
		alert('Please register for download');
	});

});

</script>

<div>
	<?php echo link_to('Learn vietnamese online >','@homepage') ?>
	<?php
		if( isset($coursename ) )
			echo link_to( $coursename . '>', 'course/show?id='. $sf_request->getParameter('courseid',0) );
		else
			echo "Unknow";
	?>
	
	<?php
		if(isset($levelname))
			echo link_to( $levelname, 'level/show?id=' . $sf_request->getParameter('levelid',0) . '&courseid='.$sf_request->getParameter('courseid',0) );
		else
			echo "Unknow";
	?>
	<ul id="qnavlist" >
	<li><p id="qheader" style="border-bottom:1px solid #CCCC00; " ><?php echo $coursename . ' - '. $levelname ?> </p></li>
	<li><?php echo link_to('LevelTest', 'leveltest/index?courseid='.$sf_request->getParameter('courseid',0).'&levelid='.$sf_request->getParameter('levelid',0)); ?></li>
	<li>Schedule</li>
	<li><?php echo link_to('Syllabus', 'syllabus/index?courseid='.$sf_request->getParameter('courseid',0).'&levelid='.$sf_request->getParameter('levelid',0) );?></li>
	<li><?php echo link_to('Study Kit', 'levelstudykit/index?courseid='.$sf_request->getParameter('courseid',0).'&levelid='.$sf_request->getParameter('levelid',0) );?></li>
	</ul>
	<p><?php echo link_to('SignUp', '@homepage') ?></p>
</div>
<div>
    <?php foreach ( $rows as $levelkit): ?>
	<div>
		<p> <?php echo $coursename . ' - '. $levelname?> </p>
		<?php echo image_tag('/uploads/assets/levelstudykit/'.utilities::getSpreadPathByDate($levelkit->getCreatedAt()).'/thumb_'.$levelkit->getLskImage(), array('style'=>'align: left;', 'width'=>'87','height'=>'87','border'=>'0','align'=>'left','title'=>$levelkit->getLskImage(),'alt'=>$levelkit->getLskImage())); ?>
		<p>
		<?php if( $sf_user->getAttribute('isPermit') == '1' )  echo link_to( 'download document', '/assets/doc/levelstudykit/'.utilities::getSpreadPathByDate($levelkit->getCreatedAt()).'/'.$levelkit->getLskLink() ) ;
			else echo "<a href='#' class='noneregist'>" . $levelkit->getLskLink() . "</a>";
		 ?>
		</p>
	</div>
    <?php endforeach; ?>
</div>
<div>
	<?php if ($pager->haveToPaginate()): ?>
	  <?php echo link_to('&laquo;', 'level/index?page='.$pager->getFirstPage()) ?>
	  <?php echo link_to('&lt;', 'level/index?page='.$pager->getPreviousPage()) ?>
	  <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
		<?php echo ($page == $pager->getPage()) ? $page : link_to($page, 'level/index?page='.$page) ?>
		<?php if ($page != $pager->getCurrentMaxLink()): ?> - <?php endif ?>
	  <?php endforeach ?>
	  <?php echo link_to('&gt;', 'level/index?page='.$pager->getNextPage()) ?>
	  <?php echo link_to('&raquo;', 'level/index?page='.$pager->getLastPage()) ?>
	<?php endif ?>
</div>
 <!-- <a href="<?php echo url_for('level/new') ?>">New</a> -->